import java.util.Scanner;

public class Practice1 {
    /*
    链接https://ac.nowcoder.com/acm/contest/98241/A
    贪心即可
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        int count = 0;
        while(true){
            if(n >= a){
                n -= a;
                count++;
            }else{
                if(n >= b){
                    n-= b;
                    count++;
                }else{
                    if(n >= c){
                        n-= c;
                        count++;
                    }else{
                        break;
                    }
                }
            }
        }
        System.out.println(count);
    }
}
